
package chapter11;

import org.junit.Test;

public class NewThreadTest{
	
	@Test
	public void nThreadTest(){		
		new NewThread();
		try{
			for(int i = 5; i > 0; i--){
				System.out.println("Main Thread: " + i);
				Thread.sleep(1000);				
			}			
		}catch(InterruptedException e){
			System.out.println("Main Thread Interrupted");
		}
		System.out.println("Main thread exiting");		
	}
	
	@Test
	public void nThread2Test(){
		new NewThread2();
		try{
			for(int i=5;i>0;i--){
				System.out.println("Main Thread: " + i);
				Thread.sleep(1000);
			}
		}catch(InterruptedException e){
			System.out.println("Main Thread Interrupted");
		}
		System.out.println("Main thread exiting");
	}
	
	
}
	

